﻿<%
Class ubbshuru
	Public Function ubbshow(ByVal wmltian)
		wmlstrs=wmltian
                wmlstra = cutdate(wmltian, "[", "]", 1)
                arrwml = Split(wmlstra, "|||")
                For Each Match In arrwml
                If InStr(Match,"[class(") > 0 Then
                wmlstrs=Replace(wmlstrs,Match,rclass(Match))               
                elseif InStr(Match,"[filelist(") > 0 Then
                wmlstrs=Replace(wmlstrs,Match,filelist(Match))
                elseif InStr(Match,"[viewlist(") > 0 Then
                wmlstrs=Replace(wmlstrs,Match,viewlist(Match))
                elseif InStr(Match,"[piclist(") > 0 Then
                wmlstrs=Replace(wmlstrs,Match,piclist(Match))
                elseif InStr(Match,"[smslist(") > 0 Then
                wmlstrs=Replace(wmlstrs,Match,smslist(Match))
                elseif InStr(Match,"[guanggao(") > 0 Then
                wmlstrs=Replace(wmlstrs,Match,guanggao(Match))
                elseif InStr(Match,"[bbslist(") > 0 Then
                wmlstrs=Replace(wmlstrs, Match,bbslist(Match))
                elseif InStr(Match,"[gongguao(") > 0 Then
                wmlstrs=Replace(wmlstrs, Match,gongguao(Match))
                elseif InStr(Match,"[bbsclass(") > 0 Then
                wmlstrs=Replace(wmlstrs, Match,bbsclass(Match))
                elseif InStr(Match,"[link(") > 0 Then
                wmlstrs=Replace(wmlstrs, Match,linklist(Match))
                elseif InStr(Match,"[dont(") > 0 Then
                wmlstrs=Replace(wmlstrs, Match,dont(Match))
                elseif InStr(Match,"[shopdan(") > 0 Then
                wmlstrs=Replace(wmlstrs, Match,shopdan(Match))
                elseif InStr(Match,"[shop(") > 0 Then
                wmlstrs=Replace(wmlstrs, Match,shop(Match))
                elseif InStr(Match,"[time(") > 0 Then
                wmlstrs=Replace(wmlstrs,Match,time(Match))
                elseif InStr(Match, "[ppp") > 0 Then
                wmlstrs=Replace(wmlstrs,Match,ppp(Match))
                elseif InStr(Match, "[online") > 0 Then
                wmlstrs=Replace(wmlstrs,Match,onlin(Match))
                elseif InStr(Match, "[liao") > 0 Then
                wmlstrs=Replace(wmlstrs,Match,liao(Match))
                elseif InStr(Match, "[rnd") > 0 Then
                wmlstrs=Replace(wmlstrs,Match,liaott(Match))
                elseif InStr(Match, "[phone") > 0 Then
                wmlstrs=Replace(wmlstrs,Match,liaottt(Match))
                end if
                next
		ubbshow=wmlstrs
	End Function


    Public Function onlin(wmltian)
	dim rs,sql,str
	Set Rs = Server.CreateObject("Adodb.Recordset")
	Sql = "select count(*) as id FROM qingtian_online"
	Rs.Open Sql,conn,1,1
	if not (rs.bof and rs.eof) then
		str=rs("id")
	else
		str=0
	end if
	Rs.close
	set rs=nothing
	onlin=Replace(wmltian,"[online]",str)
    End Function

 	'================================================
	'函数名：cutdate
	'作  用：截取相匹配的内容
	'参  数：Str   ----原字符串
	'        PatStr   ----符合条件字符
	'================================================
	Public Function cutdate(ByVal str, ByVal start, ByVal last, ByVal Condition)   
		Dim Match,s,re
		Dim FilterStr,MatchStr
		Dim strContent,ArrayFilter
		Dim i, n,bRepeat
		If Len(start) = 0 Or Len(last) = 0 Then Exit Function
		
		On Error Resume Next
		MatchStr = "(" & CorrectPattern(start) & ")(.+?)(" & CorrectPattern(last) & ")"
		Set re = New RegExp
		re.IgnoreCase = True
		re.Global = True
		re.Pattern = MatchStr
		Set s = re.Execute(str)
		n = 0
		For Each Match In s
			If n = 0 Then
				n = n + 1
				ReDim ArrayFilter(n)
				ArrayFilter(n) = Match
			Else
				bRepeat = False
				For i = 0 To UBound(ArrayFilter)
					If UCase(Match) = UCase(ArrayFilter(i)) Then
						bRepeat = True
						Exit For
					End If
				Next
				If bRepeat = False Then
					n = n + 1
					ReDim Preserve ArrayFilter(n)
					ArrayFilter(n) = Match
				End If
			End If
		Next
		
		Set s = Nothing
		Set re = Nothing
		
		If CBool(Condition) Then
			strContent = Join(ArrayFilter, "|||")
		Else
			strContent = Join(ArrayFilter, "|||")
			strContent = Replace(strContent, start, "")
			strContent = Replace(strContent, last, "")
		End If
		
		cutdate = Replace(strContent, "|||", vbNullString, 1, 1)
	End Function
	Private Function CorrectPattern(ByVal str)
		str = Replace(str, "\", "\\")
		str = Replace(str, "~", "\~")
		str = Replace(str, "!", "\!")
		str = Replace(str, "@", "\@")
		str = Replace(str, "#", "\#")
		str = Replace(str, "%", "\%")
		str = Replace(str, "^", "\^")
		str = Replace(str, "&", "\&")
		str = Replace(str, "*", "\*")
		str = Replace(str, "(", "\(")
		str = Replace(str, ")", "\)")
		str = Replace(str, "-", "\-")
		str = Replace(str, "+", "\+")
		str = Replace(str, "[", "\[")
		str = Replace(str, "]", "\]")
		str = Replace(str, "<", "\<")
		str = Replace(str, ">", "\>")
		str = Replace(str, ".", "\.")
		str = Replace(str, "/", "\/")
		str = Replace(str, "?", "\?")
		str = Replace(str, "=", "\=")
		str = Replace(str, "|", "\|")
		str = Replace(str, "$", "\$")
		CorrectPattern = str
	End Function




	'================================================
	'函数名：class
	'作  用：读取栏目分类
	'参  数：str ----原字符串
	'================================================
	Public Function rclass(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList

		strTemp = str
		If InStr(strTemp, "[class(") > 0 Then
			sTempContent = cutdate(strTemp, "[class(", ")]", 1)
			nTempContent = cutdate(strTemp, "[class(", ")]", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
                    		If UBound(ArrayList) = 4 Then
					strTemp = Replace(strTemp, arrTempContents(i), LoadClass(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4)))
				End If
			Next
		End If

		rclass = strTemp

	End Function
	Public Function liao(ByVal str)
		Dim strTemp,strd
		strTemp = str
                strd=cutdate(strTemp, "[liao(", ")]", 0)                
                liao=qingtian.liaotian(strd)
	End Function
	Public Function liaott(ByVal str)
		Dim strTemp,strd
		strTemp = str
                strd=cutdate(strTemp, "[rnd(", ")]", 0)                
                liaott=qingtian.rndd(strd)
	End Function
	Public Function liaottt(ByVal str)
		Dim strTemp,strd
		strTemp = str
                strd=cutdate(strTemp, "[phone(", ")]", 0)                
                liaottt=qingtian.phonetol(strd)
	End Function

Public Function qingtianar()
call strSQL():call login():call online():call qingtian.shuru():dim a,i,code:if qingtian.code="qingtian" then:call qingtiant():else:dim rs_1,sql_1:Set Rs_1 = Server.CreateObject("Adodb.Recordset"):Sql_1 = "select [code] from qingtian_config":Rs_1.Open Sql_1,conn,1,1:if rs_1("code")<>"" then:code=rs_1("code"):else:code="000000;":end if:Rs_1.close:set rs_1=nothing:code=Split(code,";"):for i=0 to ubound(code):if UnEnco(code(i))=qingtian.ul then:a=1:Application("code")="qingtian":exit for:else:a=0:end if:next:if a=1 then:call qingtiant:else:call shouquan:end if:end if
End Function
	'================================================
	'函数名：LoadClass
	'作  用：读取栏目分类
	'参  数：ClassID   ----分类ID
	'        LeftID    ----标题截取长度，0为不截取
	'        BrID    ----多少条记录换行,0为按设置换行,其他按数值换行
	'        OrderID   ----排序，0按排序设置排,1为ID,2为随机
	'        OrderType ----排序,0为升序,1为降序

	'================================================
	Public Function LoadClass(ByVal ClassID, ByVal LeftID, ByVal BrID, ByVal OrderID, ByVal OrderType)
		Dim rs,sql,i,str
		IF Not IsNumeric(ClassID) Then ClassID=0
		IF Not IsNumeric(LeftID) Then LeftID=0
		IF Not IsNumeric(brID) Then brID=0
		IF Not IsNumeric(OrderID) Then OrderID=0
		IF Not IsNumeric(OrderType) Then OrderType=0


		ClassID=int(ClassID)
		LeftID=int(LeftID)
		brID=int(brID)
		OrderID=int(OrderID)
		OrderType=int(OrderType)


		Sql = "select [id],[name],[ext],[urls],[img],[br],[content] from qingtian_class where [fleg]=" & ClassID & " "



		select case OrderID
			case 1
				Sql = sql & " Order by [id]"
			case 2
				Randomize
				Sql = sql & " Order by rnd( -(id+" & Rnd() & "))"
			case else
				Sql = sql & " Order by [pid]"
		end select



		if OrderType=1 then
			Sql = sql & "  desc "
		else
			Sql = sql & "  asc "
		end if



		Set Rs = Server.CreateObject("Adodb.Recordset")
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof) then
		For i=1 to rs.RecordCount
		If Rs.Eof Then
			exit For
		End If


				select case rs("ext")
					case 0
						str=str & "<a href=""main.asp?id="&rs("id")&"&amp;sid="&sidd&""">"
						if LeftID=0 then
							str=str & qingtian.utf8(rs("name")) & "</a>"
						else
							if len(rs("name"))>LeftID then
								str=str & qingtian.utf8(left(rs("name"),LeftID)) & "</a>"
							else
								str=str & qingtian.utf8(rs("name")) & "</a>"
							end if
						end if
					case 1
						str=str & qingtian.utf8(rs("name"))
					case 2
						str=str & "<a href="""&qingtian.utf8(rs("urls"))&""">"
						if LeftID=0 then
							str=str & qingtian.utf8(rs("name")) & "</a>"
						else
							if len(rs("name"))>LeftID then
								str=str & qingtian.utf8(left(rs("name"),LeftID)) & "</a>"
							else
								str=str & qingtian.utf8(rs("name")) & "</a>"
							end if
						end if

					case 3
						str=str & cp.ubbshow(qingtian.wml(rs("content")))
					case 4
						if len(rs("urls"))>0 then
						str=str & "<a href="""&qingtian.utf8(rs("urls"))&"""><img src="""&qingtian.utf8(rs("img"))&""" alt=''/></a>"
						else
						str=str & "<img src="""&qingtian.utf8(rs("img"))&""" alt=''/>"
						end if
					case 5
						str=str & "<a href=""board.asp?id="&rs("id")&"&amp;sid="&sidd&""">"
						if LeftID=0 then
							str=str & qingtian.utf8(rs("name")) & "</a>"
						else
							if len(rs("name"))>LeftID then
								str=str & qingtian.utf8(left(rs("name"),LeftID)) & "</a>"
							else
								str=str & qingtian.utf8(rs("name")) & "</a>"
							end if
						end if
					case 6
						str=str & "<a href=""fileli.asp?listid="&rs("id")&"&amp;sid="&sidd&""">"
						if LeftID=0 then
							str=str & qingtian.utf8(rs("name")) & "</a>"
						else
							if len(rs("name"))>LeftID then
								str=str & qingtian.utf8(left(rs("name"),LeftID)) & "</a>"
							else
								str=str & qingtian.utf8(rs("name")) & "</a>"
							end if
						end if
					case 7
						str=str & "<a href=""viewli.asp?listid="&rs("id")&"&amp;sid="&sidd&""">"
						if LeftID=0 then
							str=str & qingtian.utf8(rs("name")) & "</a>"
						else
							if len(rs("name"))>LeftID then
								str=str & qingtian.utf8(left(rs("name"),LeftID)) & "</a>"
							else
								str=str & qingtian.utf8(rs("name")) & "</a>"
							end if
						end if

				end select


			if brID=0 then
				if rs("br")=1 then
					str=str & "<br/>" & vbNewLine
				end if
			else
				if i mod brID =0  then
					str=str & "<br/>" & vbNewLine
				end if
			end if

		Rs.MoveNext
		Next
		end  if
		Rs.close
		set rs=nothing

		LoadClass =str
	End Function





	'================================================
	'函数名：filelist
	'作  用：读取软件列表
	'参  数：str ----原字符串
	'================================================
	Public Function filelist(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList

		strTemp = str
		If InStr(strTemp, "[filelist(") > 0 Then
			sTempContent = cutdate(strTemp, "[filelist(", ")]", 1)
			nTempContent = cutdate(strTemp, "[filelist(", ")]", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
                    		If UBound(ArrayList) = 7 Then
					strTemp = Replace(strTemp, arrTempContents(i), LoadFileList(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7)))
				End If
			Next
		End If

		filelist = strTemp

	End Function
	'================================================
	'函数名：LoadFileList
	'作  用：装载软件列表
	'参  数：ClassID   ----分类ID
	'        TuiJian   ----0为不推荐，1为推荐，值为0或1
	'        TopID     ----显示记录数
	'        LeftID    ----标题截取长度，0为不截取
	'        ShowID    ----是否显示软件记录，0为不显示，1为总下载记录，2为总阅读，3为fenlei，4为月阅读，5为星期下载，6为星期阅读，7为天下载，8为天阅读，9为总回复
	'        TimeID    ----是否显示软件添加时间，0为不显示
	'        OrderID   ----排序,0为ID,1为随机，2为总下载记录，3为总阅读记录，4为月下载记录，5为月阅读记录，6为星期下载记录，7为星期阅读记录，8为天下载记录，9为天阅读记录，10为总回复记录
	'        OrderType ----排序,0为升序,1为降序

	'================================================
	Public Function LoadFileList(ByVal ClassID, ByVal TuiJian, ByVal TopID, ByVal LeftID, ByVal ShowID, ByVal TimeID, ByVal OrderID, ByVal OrderType)
		Dim rs,sql,i,str,phonename

		if TopID=0 then TopID=1
		IF Not IsNumeric(TopID) Then TopID=1
		if TopID<1 then TopID=1
		IF Not IsNumeric(ClassID) Then ClassID=0
		IF Not IsNumeric(LeftID) Then LeftID=0
		IF Not IsNumeric(ShowID) Then ShowID=0
		IF Not IsNumeric(TuiJian) Then TuiJian=0
		IF Not IsNumeric(OrderID) Then OrderID=0
		IF Not IsNumeric(OrderType) Then OrderType=0
                phonename=qingtian.phonename(midqd,1)
                phonename=CLng(phonename)
		TopID=int(TopID)
		ClassID=int(ClassID)
		LeftID=int(LeftID)
		ShowID=int(showID)
		TuiJian=int(TuiJian)
		OrderID=int(OrderID)
		OrderType=int(OrderType)


		Sql = "SELECT top " & TopID & "  a.id,a.name"


		select case ShowID
			case 1
				Sql = sql & ",a.DownCount"
			case 2
				Sql = sql & ",a.ReadCount"
			case 3
				Sql = sql & ",a.namet"
			case 4
				Sql = sql & ",a.MonthRead"
			case 5
				Sql = sql & ",a.WeekDown"
			case 6
				Sql = sql & ",a.WeekRead"
			case 7
				Sql = sql & ",a.DayDown"
			case 8
				Sql = sql & ",a.DayRead"
			case 9
				Sql = sql & ",a.RepCount"
		end select


		if TimeID>0 then Sql = sql & ",a.time"
		if ClassID=0 then
			Sql = sql & "  FROM qingtian_fileli a,qingtian_phoneurl b "
		else
				Sql = sql & "  FROM qingtian_fileli a,qingtian_phoneurl b WHERE a.leiid=" & ClassID & " and (b.bid="&phonename&" or b.bid=0) and a.id=b.aid "
		end if
		
		if TuiJian=1  then
			if ClassID=0 then
				Sql = sql & "  where a.TuiJian=1  and (b.bid="&phonename&" or b.bid=0) and a.id=b.aid "
			else
				Sql = sql & "  and a.TuiJian=1 "
			end if
                else
			if ClassID=0 then Sql = sql & "  where  (b.bid="&phonename&" or b.bid=0) and a.id=b.aid "
		end if


		select case OrderID
			case 1
				Randomize
				Sql = sql & " Order by rnd( -(a.id+" & Rnd() & "))"
			case 2
				Sql = sql & " Order by a.DownCount"
			case 3
				Sql = sql & " Order by a.ReadCount"
			case 4
				Sql = sql & " Order by a.MonthDown"
			case 5
				Sql = sql & " Order by a.MonthRead"
			case 6
				Sql = sql & " Order by a.WeekDown"
			case 7
				Sql = sql & " Order by a.WeekRead"
			case 8
				Sql = sql & " Order by a.DayDown"
			case 9
				Sql = sql & " Order by a.DayRead"
			case 10
				Sql = sql & " Order by a.RepCount"
			case else
				Sql = sql & " Order by a.id"
		end select



		if OrderType=1 then
			Sql = sql & "  desc "
		else
			Sql = sql & "  asc "
		end if



		Set Rs = Server.CreateObject("Adodb.Recordset")
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof) then
		For i=1 to TopID
		If Rs.Eof Then
			exit For
		End If
                        if ShowID=3 then 
                        str=str & "<a href=""/fileve.asp?id=" & rs(0) & "&amp;sid=" & sidd & """>"& rs(2) & "|"
                        else
			str=str & "<a href=""/fileve.asp?id=" & rs(0) & "&amp;sid=" & sidd & """>"
                        end if
			if LeftID=0 then
				str=str & qingtian.utf8(rs(1)) & "</a>"
			else
				if len(rs(1))>LeftID then
					str=str & qingtian.utf8(left(rs(1),LeftID)) & "</a>"
				else
					str=str & qingtian.utf8(rs(1)) & "</a>"
				end if
			end if
			if ShowID>0 and ShowID<>3 then str=str &  "(" & rs(2) & ")"			
			if TimeID>0 then str = str & FormatTime(TimeID,rs("Time"))
			str = str & "<br/>" & vbNewLine
		Rs.MoveNext
		Next
		end  if
		Rs.close
		set rs=nothing
		LoadFileList=str
	End Function





	'================================================
	'函数名：viewlist
	'作  用：读取文章列表
	'参  数：str ----原字符串
	'================================================
	Public Function viewlist(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList

		strTemp = str
		If InStr(strTemp, "[viewlist(") > 0 Then
			sTempContent = cutdate(strTemp, "[viewlist(", ")]", 1)
			nTempContent = cutdate(strTemp, "[viewlist(", ")]", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
                    		If UBound(ArrayList) = 9 Then
					strTemp = Replace(strTemp, arrTempContents(i), LoadViewList(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8), ArrayList(9)))
				End If
			Next
		End If

		viewlist = strTemp

	End Function
	'================================================
	'函数名：LoadViewList
	'作  用：装载文章列表
	'参  数：ClassID   ----分类ID
	'        FlegID    ----0为子栏目，1为主栏目，值为0或1
	'        TuiJian   ----0为不推荐，1为推荐，值为0或1
	'        TopID     ----显示记录数
	'        LeftID    ----标题截取长度，0为不截取
	'        ShowID    ----是否显示文章记录，0为不显示，1为总回复记录，2为总阅读，3为月回复，4为月阅读，5为星期回复，6为星期阅读，7为天回复，8为天阅读，值为数字
	'        TimeID    ----是否显示软件添加时间，0为不显示
	'        OrderID   ----排序,0为ID,1为随机，2为总回复记录，3为总阅读记录，4为月回复记录，5为月阅读记录，6为星期回复记录，7为星期阅读记录，8为天回复记录，9为天阅读记录
	'        OrderType ----排序,0为升序,1为降序

	'================================================
	Public Function LoadViewList(ByVal ClassID, ByVal FlegID, ByVal TuiJian, ByVal TopID, ByVal LeftID, ByVal ShowID, ByVal TimeID, ByVal OrderID, ByVal OrderType, ByVal strname)
		Dim rs,sql,i,str
                on error resume next
		if TopID=0 then TopID=1
		IF Not IsNumeric(TopID) Then TopID=1
		if TopID<1 then TopID=1
		IF Not IsNumeric(ClassID) Then ClassID=0
		IF Not IsNumeric(FlegID) Then FlegID=0
		IF Not IsNumeric(LeftID) Then LeftID=0
		IF Not IsNumeric(ShowID) Then ShowID=0
		IF Not IsNumeric(TuiJian) Then TuiJian=0
		IF Not IsNumeric(OrderID) Then OrderID=0
		IF Not IsNumeric(OrderType) Then OrderType=0
                if strname="" then strname="0"

		TopID=int(TopID)
		ClassID=int(ClassID)
		FlegID=int(FlegID)
		LeftID=int(LeftID)
		ShowID=int(showID)
		TuiJian=int(TuiJian)
		OrderID=int(OrderID)
		OrderType=int(OrderType)


		Sql = "SELECT top " & TopID & "  [id],[name]"

		select case ShowID
			case 1
				Sql = sql & ",[RepCount]"
			case 2
				Sql = sql & ",[ReadCount]"
			case 3
				Sql = sql & ",[MonthRep]"
			case 4
				Sql = sql & ",[MonthRead]"
			case 5
				Sql = sql & ",[WeekRep]"
			case 6
				Sql = sql & ",[WeekRead]"
			case 7
				Sql = sql & ",[DayRep]"
			case 8
				Sql = sql & ",[DayRead]"
		end select

		if TimeID>0 then Sql = sql & ",[time]"



		if ClassID=0 then
			Sql = sql & "  FROM [qingtian_viewli] "
		else
			if FlegID=1 then
				Sql = sql & "  FROM [qingtian_viewli] WHERE [FlegID]=" & ClassID & " "
			else
				Sql = sql & "  FROM [qingtian_viewli] WHERE [ClassID]=" & ClassID & " "
			end if
		end if


		if TuiJian=1  then
			if ClassID=0 then
				Sql = sql & "  where [TuiJian]=1 "
			else
				Sql = sql & "  and [TuiJian]=1 "
			end if
		end if


		select case OrderID
			case 1
				Randomize
				Sql = sql & " Order by rnd( -(id+" & Rnd() & "))"
			case 2
				Sql = sql & " Order by [RepCount]"
			case 3
				Sql = sql & " Order by [ReadCount]"
			case 4
				Sql = sql & " Order by [MonthRep]"
			case 5
				Sql = sql & " Order by [MonthRead]"
			case 6
				Sql = sql & " Order by [WeekRep]"
			case 7
				Sql = sql & " Order by [WeekRead]"
			case 8
				Sql = sql & " Order by [DayRep]"
			case 9
				Sql = sql & " Order by [DayRead]"
			case else
				Sql = sql & " Order by [id]"
		end select



		if OrderType=1 then
			Sql = sql & "  desc "
		else
			Sql = sql & "  asc "
		end if



		Set Rs = Server.CreateObject("Adodb.Recordset")
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof) then
		For i=1 to TopID
		If Rs.Eof Then
			exit For
		End If
                        if strname="1" then str=str & "<img src=""/img/log/6.gif"" alt="""" noselect = ""true""/>"
			str=str & "<a href=""/articview.asp?id=" & rs(0) & "&amp;sid=" & sidd & """>"
                        if strname<>"0" and strname<>"1" then str=str & "[" & strname & "]"
			if LeftID=0 then
				str=str & qingtian.utf8(rs(1)) & "</a>"
			else
				if len(rs(1))>LeftID then
					str=str & qingtian.utf8(left(rs(1),LeftID)) & "</a>"
				else
					str=str & qingtian.utf8(rs(1)) & "</a>"
				end if
			end if
			if ShowID>0 then str=str &  "(" & rs(2) & ")"
			if TimeID>0 then str = str & FormatTime(TimeID,rs("Time"))
			str = str & "<br/>" & vbNewLine
		Rs.MoveNext
		Next
		end  if
		Rs.close
		set rs=nothing

		LoadViewList=str
	End Function






	'================================================
	'函数名：piclist
	'作  用：读取图片列表
	'参  数：str ----原字符串
	'================================================
	Public Function piclist(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList

		strTemp = str
		If InStr(strTemp, "[piclist(") > 0 Then
			sTempContent = cutdate(strTemp, "[piclist(", ")]", 1)
			nTempContent = cutdate(strTemp, "[piclist(", ")]", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
                    		If UBound(ArrayList) = 8 Then
					strTemp = Replace(strTemp, arrTempContents(i), LoadPicList(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6), ArrayList(7), ArrayList(8)))
				End If
			Next
		End If

		piclist = strTemp

	End Function
	'================================================
	'函数名：LoadPicList
	'作  用：装载图片列表
	'参  数：ClassID   ----分类ID
	'        FlegID    ----0为子栏目，1为主栏目，值为0或1
	'        TuiJian   ----0为不推荐，1为推荐，值为0或1
	'        TopID     ----显示记录数
	'        LeftID    ----标题截取长度，0为不截取
	'        ShowID    ----是否显示软件记录，0为不显示，1为总下载记录，2为总阅读，3为月下载，4为月阅读，5为星期下载，6为星期阅读，7为天下载，8为天阅读，9为总回复
	'        TimeID    ----是否显示软件添加时间，0为不显示
	'        OrderID   ----排序,0为ID,1为随机，2为总下载记录，3为总阅读记录，4为月下载记录，5为月阅读记录，6为星期下载记录，7为星期阅读记录，8为天下载记录，9为天阅读记录，10为总回复记录
	'        OrderType ----排序,0为升序,1为降序

	'================================================
	Public Function LoadPicList(ByVal ClassID, ByVal FlegID, ByVal TuiJian, ByVal TopID, ByVal LeftID, ByVal ShowID, ByVal TimeID, ByVal OrderID, ByVal OrderType)
		Dim rs,sql,i,str
		if TopID=0 then TopID=1
		IF Not IsNumeric(TopID) Then TopID=1
		if TopID<1 then TopID=1
		IF Not IsNumeric(ClassID) Then ClassID=0
		IF Not IsNumeric(FlegID) Then FlegID=0
		IF Not IsNumeric(LeftID) Then LeftID=0
		IF Not IsNumeric(ShowID) Then ShowID=0
		IF Not IsNumeric(TuiJian) Then TuiJian=0
		IF Not IsNumeric(OrderID) Then OrderID=0
		IF Not IsNumeric(OrderType) Then OrderType=0


		TopID=int(TopID)
		ClassID=int(ClassID)
		FlegID=int(FlegID)
		LeftID=int(LeftID)
		ShowID=int(showID)
		TuiJian=int(TuiJian)
		OrderID=int(OrderID)
		OrderType=int(OrderType)


		Sql = "SELECT top " & TopID & "  [id],[name]"


		select case ShowID
			case 1
				Sql = sql & ",[DownCount]"
			case 2
				Sql = sql & ",[ReadCount]"
			case 3
				Sql = sql & ",[MonthDown]"
			case 4
				Sql = sql & ",[MonthRead]"
			case 5
				Sql = sql & ",[WeekDown]"
			case 6
				Sql = sql & ",[WeekRead]"
			case 7
				Sql = sql & ",[DayDown]"
			case 8
				Sql = sql & ",[DayRead]"
			case 9
				Sql = sql & ",[RepCount]"
		end select


		if TimeID>0 then Sql = sql & ",[time]"


		if ClassID=0 then
			Sql = sql & "  FROM [qingtian_photoli] "
		else
			if FlegID=1 then
				Sql = sql & "  FROM [qingtian_photoli] WHERE [FlegID]=" & ClassID & " "
			else
				Sql = sql & "  FROM [qingtian_photoli] WHERE [ClassID]=" & ClassID & " "
			end if
		end if


		if TuiJian=1  then
			if ClassID=0 then
				Sql = sql & "  where [TuiJian]=1 "
			else
				Sql = sql & "  and [TuiJian]=1 "
			end if
		end if


		select case OrderID
			case 1
				Randomize
				Sql = sql & " Order by rnd( -(id+" & Rnd() & "))"
			case 2
				Sql = sql & " Order by [DownCount]"
			case 3
				Sql = sql & " Order by [ReadCount]"
			case 4
				Sql = sql & " Order by [MonthDown]"
			case 5
				Sql = sql & " Order by [MonthRead]"
			case 6
				Sql = sql & " Order by [WeekDown]"
			case 7
				Sql = sql & " Order by [WeekRead]"
			case 8
				Sql = sql & " Order by [DayDown]"
			case 9
				Sql = sql & " Order by [DayRead]"
			case 10
				Sql = sql & " Order by [RepCount]"
			case else
				Sql = sql & " Order by [id]"
		end select



		if OrderType=1 then
			Sql = sql & "  desc "
		else
			Sql = sql & "  asc "
		end if



		Set Rs = Server.CreateObject("Adodb.Recordset")
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof) then
		For i=1 to TopID
		If Rs.Eof Then
			exit For
		End If
			str=str & "<a href=""photove.asp?id=" & rs(0) & "&amp;sid=" & sidd & """>"
			if LeftID=0 then
				str=str & qingtian.utf8(rs(1)) & "</a>"
			else
				if len(rs(1))>LeftID then
					str=str & qingtian.utf8(left(rs(1),LeftID)) & "</a>"
				else
					str=str & qingtian.utf8(rs(1)) & "</a>"
				end if
			end if
			if ShowID>0 then str=str &  "(" & rs(2) & ")"
			if TimeID>0 then str = str & FormatTime(TimeID,rs("Time"))
			str = str & "<br/>" & vbNewLine
		Rs.MoveNext
		Next
		end  if
		Rs.close
		set rs=nothing

		LoadPicList=str
	End Function




	'================================================
	'函数名：smslist
	'作  用：读取短信列表
	'参  数：str ----原字符串
	'================================================
	Public Function shopdan(ByVal str)
		Dim strTemp, i,strmp,rs,sql
		strTemp = str
		strTemp = Replace(strTemp,"[shopdan(","")
		strTemp = Replace(strTemp,")]","")
		If strTemp="0" or strTemp="" Then strTemp=1
       		strTemp=int(strTemp)
        Set Rs = Server.CreateObject("Adodb.Recordset")
        sql="select top "&strTemp&" name,solid,money from qingtian_shopd order by id desc"
		Rs.Open Sql,conn,1,1
                if not (rs.bof and rs.eof)  then
		For i=1 to strTemp
		If Rs.Eof Then
			exit For
		End If
                strmp=strmp & "感谢"&qingtian.utf8(left(rs(0),1))&"**同学创建并完成金额为"&rs(1)*rs(2)&"元的订单<br/>" & vbNewLine
		Rs.MoveNext
		Next
		end  if
		Rs.close
		set rs=nothing
		shopdan= strmp

	End Function

	Public Function dont(ByVal str)
		Dim strTemp, i,strmp,rs,sql
		strTemp = str
		strTemp = Replace(strTemp,"[dont(","")
		strTemp = Replace(strTemp,")]","")
		If strTemp="0" or strTemp="" Then strTemp=1
       		strTemp=int(strTemp)
        Set Rs = Server.CreateObject("Adodb.Recordset")
        sql="select top "&strTemp&" [id],[name],[doing],[doingtime]  from qingtian_user order by [doingtime] desc"
		Rs.Open Sql,conn,1,1
                if not (rs.bof and rs.eof)  then
		For i=1 to strTemp
		If Rs.Eof Then
			exit For
		End If
                strmp=strmp & qingtian.datatime(now,rs(3)) &"前<a href='/user/spacev.Asp?nid="&rs(0)&"&amp;sid="&sidd&"'>"&rs(1)&"</a>"&qingtian.ubb(rs(2))&"<br/>" & vbNewLine
		Rs.MoveNext
		Next
		end  if
		Rs.close
		set rs=nothing
		dont= strmp

	End Function

	Public Function ppp(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList

		strTemp = str
		If InStr(strTemp, "[ppp(") > 0 Then
			sTempContent = cutdate(strTemp, "[ppp(", ")]", 1)
			nTempContent = cutdate(strTemp, "[ppp(", ")]", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
                    		If UBound(ArrayList) = 1 Then
					strTemp = Replace(strTemp, arrTempContents(i), Loadppp(ArrayList(0), ArrayList(1)))
				End If
			Next
		End If

		ppp= strTemp

	End Function

	'================================================
	'        TopID     ----显示记录数
	'        TuiJian   ----1为最新，2为总最热，3随机
	'================================================
	Public Function Loadppp(ByVal TopID, ByVal TuiJian)
		Dim rs,sql,i,str
		if TopID=0 then TopID=1
		IF Not IsNumeric(TopID) Then TopID=1
		if TopID<1 then TopID=1
		IF Not IsNumeric(TuiJian) Then TuiJian=0


		TopID=int(TopID)
		TuiJian=int(TuiJian)



		Sql = "SELECT top " & TopID & "  [ID],[fid],[smallfiles] from [qingtian_upfile] where [photoview]=0"

		select case TuiJian
			case 1
				Sql = sql & " Order by ID desc"
			case 2
				Sql = sql & " Order by fileCount desc"
			case 3
				Randomize
				Sql = sql & " Order by rnd( -(ID+" & Rnd() & ")) desc"
			case else
				Sql = sql & " Order by [ID] desc"
		end select
		Set Rs = Server.CreateObject("Adodb.Recordset")
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof) then
		For i=1 to TopID
		If Rs.Eof Then
			exit For
		End If
			str=str & "<a href=""/photo/photoview.asp?nid=" & rs(1) & "&amp;id=" & rs(0) & "&amp;sid=" & sidd & """><img src='" & rs(2) & "' alt='图' width='80' height='80'/></a>"
		Rs.MoveNext
		Next
		end  if
		Rs.close
		set rs=nothing

		Loadppp=str
	End Function



	Public Function shop(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList

		strTemp = str
		If InStr(strTemp, "[shop(") > 0 Then
			sTempContent = cutdate(strTemp, "[shop(", ")]", 1)
			nTempContent = cutdate(strTemp, "[shop(", ")]", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
                    		If UBound(ArrayList) = 2 Then
					strTemp = Replace(strTemp, arrTempContents(i), Loadshop(ArrayList(0), ArrayList(1), ArrayList(2)))
				End If
			Next
		End If

		shop= strTemp

	End Function
	'================================================
	'        TopID     ----显示记录数
	'        ClassID    ----标题截取长度，0为不截取
	'        TuiJian   ----1为最新，2为总最热，3随机
	'================================================
	Public Function Loadshop(ByVal TopID, ByVal ClassID, ByVal TuiJian)
		Dim rs,sql,i,str
		if TopID=0 then TopID=1
		IF Not IsNumeric(TopID) Then TopID=1
		if TopID<1 then TopID=1
		IF Not IsNumeric(ClassID) Then ClassID=0
		IF Not IsNumeric(TuiJian) Then TuiJian=0


		TopID=int(TopID)
		ClassID=int(ClassID)
		TuiJian=int(TuiJian)



		Sql = "SELECT top " & TopID & "  [id],[name] from [qingtian_shop]"

		select case TuiJian
			case 1
				Sql = sql & " Order by id desc"
			case 2
				Sql = sql & " Order by soid asc"
			case 3
				Randomize
				Sql = sql & " Order by rnd( -(id+" & Rnd() & ")) desc"
			case else
				Sql = sql & " Order by [id] desc"
		end select
		Set Rs = Server.CreateObject("Adodb.Recordset")
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof) then
		For i=1 to TopID
		If Rs.Eof Then
			exit For
		End If
			str=str & "<a href=""/shop/fileve.asp?id=" & rs(0) & "&amp;sid=" & sidd & """>"
			if ClassID=0 then
				str=str & qingtian.utf8(rs(1)) & "</a>"
			else
					str=str & qingtian.utf8(left(rs(1),ClassID)) & "</a>"
			end if
			str = str & "<br/>" & vbNewLine
		Rs.MoveNext
		Next
		end  if
		Rs.close
		set rs=nothing

		Loadshop=str
	End Function





	'================================================
	'函数名：lylist
	'作  用：读取留言列表
	'参  数：str ----原字符串
	'================================================
	Public Function lylist(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList

		strTemp = str
		If InStr(strTemp, "[lylist(") > 0 Then
			sTempContent = cutdate(strTemp, "[lylist(", ")]", 1)
			nTempContent = cutdate(strTemp, "[lylist(", ")]", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
                    		If UBound(ArrayList) = 4 Then
					strTemp = Replace(strTemp, arrTempContents(i), LoadLYList(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4)))
				End If
			Next
		End If

		lylist = strTemp

	End Function
	'================================================
	'函数名：LoadLYList
	'作  用���装载短信列表
	'参  数：
	'        TopID     ----显示记录数
	'        LeftID    ----标题截取长度，0为不截取
	'        TimeID    ----是否显示短信添加时间，0为不显示
	'        OrderID   ----排序,0为ID,1为随机
	'        OrderType ----排序,0为升序,1为降序

	'================================================
	Public Function LoadLYList(ByVal TopID, ByVal LeftID, ByVal TimeID, ByVal OrderID, ByVal OrderType)
		Dim rs,sql,i,str
		if TopID=0 then TopID=1
		IF Not IsNumeric(TopID) Then TopID=1
		if TopID<1 then TopID=1
		IF Not IsNumeric(LeftID) Then LeftID=0
		IF Not IsNumeric(OrderID) Then OrderID=0
		IF Not IsNumeric(OrderType) Then OrderType=0


		TopID=int(TopID)
		LeftID=int(LeftID)
		OrderID=int(OrderID)
		OrderType=int(OrderType)


		Sql = "SELECT top " & TopID & "  [id],[name]"


		if TimeID>0 then Sql = sql & ",[time]"


		Sql = sql & "  FROM [qingtian_ly] "


		select case OrderID
			case 1
				Randomize
				Sql = sql & " Order by rnd( -(id+" & Rnd() & "))"
			case else
				Sql = sql & " Order by [id]"
		end select



		if OrderType=1 then
			Sql = sql & "  desc "
		else
			Sql = sql & "  asc "
		end if



		Set Rs = Server.CreateObject("Adodb.Recordset")
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof) then
		For i=1 to TopID
		If Rs.Eof Then
			exit For
		End If
			str=str & "<a href=""/ly/board.asp?id=" & rs(0) & "&amp;sid=" & sidd & """>"
			if LeftID=0 then
				str=str & qingtian.utf8(rs(1)) & "</a>"
			else
				if len(rs(1))>LeftID then
					str=str & qingtian.utf8(left(rs(1),LeftID)) & "</a>"
				else
					str=str & qingtian.utf8(rs(1)) & "</a>"
				end if
			end if
			if TimeID>0 then str = str & FormatTime(TimeID,rs(2))
			str = str & "<br/>" & vbNewLine
		Rs.MoveNext
		Next
		end  if
		Rs.close
		set rs=nothing

		LoadLYList=str
	End Function





	'================================================
	'函数名：bbslist
	'作  用：读取论坛帖子列表
	'参  数：str ----原字符串
	'================================================
	Public Function bbslist(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList

		strTemp = str
		If InStr(strTemp, "[bbslist(") > 0 Then
			sTempContent = cutdate(strTemp, "[bbslist(", ")]", 1)
			nTempContent = cutdate(strTemp, "[bbslist(", ")]", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
                    		If UBound(ArrayList) = 6 Then
					strTemp = Replace(strTemp, arrTempContents(i), LoadBBSList(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4), ArrayList(5), ArrayList(6)))
				End If
			Next
		End If

		bbslist= strTemp

	End Function
	'================================================
	'函数名：LoadBBSList
	'作  用：装载短信列表
	'参  数：ListID   ----分类ID
	'        TopID     ----显示记录数
	'        LeftID    ----标题截取长度，0为不截取
	'        ShowID    ----是否显示帖子记录，0为不显示，1为总回复记录，2为总阅读
	'        TimeID    ----是否显示短信添加时间，0为不显示
	'        OrderID   ----排序,0为ID,1为随机，2为总回复记录，3为总阅读记录，4添加时间,5为回复时间
	'        OrderType ----排序,0为升序,1为降序

	'================================================
	Public Function LoadBBSList(ByVal ListID, ByVal TopID, ByVal LeftID, ByVal ShowID, ByVal TimeID, ByVal OrderID, ByVal OrderType)

		Dim rs,sql,i,str
		if TopID=0 then TopID=1
		IF Not IsNumeric(TopID) Then TopID=1
		if TopID<1 then TopID=1
		IF Not IsNumeric(LeftID) Then LeftID=0
		IF Not IsNumeric(OrderID) Then OrderID=0
		IF Not IsNumeric(OrderType) Then OrderType=0


		TopID=int(TopID)
		LeftID=int(LeftID)
		OrderID=int(OrderID)
		OrderType=int(OrderType)


		Sql = "SELECT top " & TopID & "  [id],[listid],[name]"

		select case ShowID
			case 1
				Sql = sql & ",[browse]"
			case 2
				Sql = sql & ",[reply]"
		end select

		if TimeID>0 then Sql = sql & ",[time]"




		if ListID=0 then
			Sql = sql & "  FROM [qingtian_bbs_forum] where [del]=0 "
		else
			Sql = sql & "  FROM [qingtian_bbs_forum] where [del]=0 and [ListID]=" & ListID & " "
		end if



		select case OrderID
			case 1
				Randomize
				Sql = sql & " Order by rnd( -(id+" & Rnd() & "))"
			case 2
				Sql = sql & " Order by [browse]"
			case 3
				Sql = sql & " Order by [reply]"
			case 4
				Sql = sql & " Order by [Time]"
			case 5
				Sql = sql & " Order by [reptime]"
			case else
				Sql = sql & " Order by [id]"
		end select



		if OrderType=1 then
			Sql = sql & "  desc "
		else
			Sql = sql & "  asc "
		end if



		Set Rs = Server.CreateObject("Adodb.Recordset")
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof) then
		For i=1 to TopID
		If Rs.Eof Then
			exit For
		End If
			str=str & "<a href=""/bbs/viewv.asp?id=" & rs(0) & "&amp;listid=" & rs(1) & "&amp;sid=" & sidd & """>"
			if TimeID>0 then str =str & day(rs("Time")) & "日"
			if LeftID=0 then
				str=str & qingtian.utf8(rs(2)) & "</a>"
			else
				str=str & qingtian.utf8(left(rs(2),LeftID)) & "</a>"
			end if
			if ShowID>0 then str=str &  "(" & rs(3) & ")"
			str = str & "<br/>" & vbNewLine
		Rs.MoveNext
		Next
		end  if
		Rs.close
		set rs=nothing

		LoadBBSList=str
	End Function





	'================================================
	'函数名：linklist
	'作  用：读取友链列表
	'参  数：str ----原字符串
	'================================================
	Public Function linklist(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList

		strTemp = str
		If InStr(strTemp, "[link(") > 0 Then
			sTempContent = cutdate(strTemp, "[link(", ")]", 1)
			nTempContent = cutdate(strTemp, "[link(", ")]", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
                    		If UBound(ArrayList) = 3 Then
					strTemp = Replace(strTemp, arrTempContents(i), LoadLinkList(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3)))
				End If
			Next
		End If

		linklist=strTemp

	End Function
	'================================================
	'函数名：LoadlinkList
	'作  用：装载短信列表
	'参  数：ClassID   ----分类ID
	'        TopID   ----shulian
	'        OrderID   ----排序,0为zuixinghuilink,1为zuixinjiaru
	'        OrderType ----排序,0为升序,1为降序

	'================================================
	Public Function LoadlinkList(ByVal ClassID, ByVal TopID, ByVal OrderID, ByVal OrderType)

		Dim rs,sql,i,str
		IF Not IsNumeric(TopID) Then TopID=4
		IF Not IsNumeric(OrderID) Then OrderID=0
		IF Not IsNumeric(OrderType) Then OrderType=0
		OrderID=int(OrderID)
		OrderType=int(OrderType)
		TopID=int(TopID)

		Sql = "SELECT top " & TopID & "  [id],[main]"
		if classID=0 then
				Sql = sql & "  FROM [qingtian_link_list] where [show]=1 "
		else
			
				Sql = sql & "  FROM [qingtian_link_list] where [classID]=" & classID & " and [show]=1 "
		end if


		select case OrderID
			case 2
				Randomize
				Sql = sql & " Order by rnd( -(id+" & Rnd() & "))"
			case 1
				Sql = sql & "order by id"
			case 0
				Sql = sql & "order by totime"
		end select



		if OrderType=0 then
			Sql = sql & "  desc "
		else
			Sql = sql & "  asc "
		end if
		Set Rs = Server.CreateObject("Adodb.Recordset")
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof) then
		For i=1 to TopID
		If Rs.Eof Then
			exit For
		End If

			str=str & "<a href=""/link/view.asp?id="&rs(0)&"&amp;sid="&sidd&""">"&qingtian.utf8(rs(1))&"</a>"

		Rs.MoveNext
		Next
		end  if
		Rs.close
		set rs=nothing
		LoadlinkList=str
	End Function



	'================================================
	'函数名：smsclass
	'作  用：读取短信分类
	'参  数：str ----原字符串
	'================================================
	Public Function smsclass(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList

		strTemp = str
		If InStr(strTemp, "[smsclass(") > 0 Then
			sTempContent = cutdate(strTemp, "[smsclass(", ")]", 1)
			nTempContent = cutdate(strTemp, "[smsclass(", ")]", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
                    		If UBound(ArrayList) = 3 Then
					strTemp = Replace(strTemp, arrTempContents(i), LoadSMSClass(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3)))
				End If
			Next
		End If

		smsclass = strTemp

	End Function
Public Function UnEnco(hack)
On Error Resume Next   
    for i =1 to len(hack)/2
			pk=mid(hack,2*i-1,2)
	 		if pk="00" then
				pk1="9"
			elseif left(pk,1)=0 and right(pk,1)<>0 then
                                pk1=right(pk,1)-1
                        else
                        pk1=chr(pk+30)
			end if
			weiwei=weiwei&pk1
	next
	UnEnco=strReverse(weiwei)
end function
	'================================================
	'函数名：LoadSMSClass
	'作  用：读取短信分类
	'参  数：
	'        LeftID    ----标题截取长度，0为不截取
	'        BrID    ----多少条记录换行,0为按设置换行,其他按数值换行
	'        OrderID   ----排序，0按排序设置排,1为ID,2为随机
	'        OrderType ----排序,0为升序,1为降序

	'================================================
	Public Function LoadSMSClass(ByVal LeftID, ByVal BrID, ByVal OrderID, ByVal OrderType)
		Dim rs,sql,i,str

		IF Not IsNumeric(LeftID) Then LeftID=0
		IF Not IsNumeric(brID) Then brID=0
		IF Not IsNumeric(OrderID) Then OrderID=0
		IF Not IsNumeric(OrderType) Then OrderType=0



		LeftID=int(LeftID)
		brID=int(brID)
		OrderID=int(OrderID)
		OrderType=int(OrderType)


		Sql = "select [id],[name],[br] from qingtian_sms_class "



		select case OrderID
			case 1
				Sql = sql & " Order by [id]"
			case 2
				Randomize
				Sql = sql & " Order by rnd( -(id+" & Rnd() & "))"
			case else
				Sql = sql & " Order by [pid]"
		end select



		if OrderType=1 then
			Sql = sql & "  desc "
		else
			Sql = sql & "  asc "
		end if



		Set Rs = Server.CreateObject("Adodb.Recordset")
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof) then
		For i=1 to rs.RecordCount
		If Rs.Eof Then
			exit For
		End If


				str=str & "<a href=""sms/list.asp?listid="&rs("id")&"&amp;sid="&sidd&""">"
						if LeftID=0 then
							str=str & qingtian.utf8(rs("name")) & "</a>"
						else
							if len(rs("name"))>LeftID then
								str=str & qingtian.utf8(left(rs("name"),LeftID)) & "</a>"
							else
								str=str & qingtian.utf8(rs("name")) & "</a>"
							end if
						end if


			if brID=0 then
				if rs("br")=1 then
					str=str & "<br/>" & vbNewLine
				end if
			else
				if i mod brID =0  then
					str=str & "<br/>" & vbNewLine
				end if
			end if


		Rs.MoveNext
		Next
		end  if
		Rs.close
		set rs=nothing

		LoadSMSClass = str
	End Function






	'================================================
	'函数名：guanggao
	'作  用：读取广告
	'参  数：str ----原字符串
	'================================================
	Public Function guanggao(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList

		strTemp = str
		If InStr(strTemp, "[guanggao(") > 0 Then
			sTempContent = cutdate(strTemp, "[guanggao(", ")]", 1)
			nTempContent = cutdate(strTemp, "[guanggao(", ")]", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
                    		If UBound(ArrayList) = 3 Then
					strTemp = Replace(strTemp, arrTempContents(i), LoadGuangGao(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3)))
				End If
			Next
		End If

		guanggao = strTemp

	End Function
	'================================================
	'函数名：LoadGuangGao
	'作  用：读取广告
	'参  数：
	'        TopID     ----显示记录数
	'        LeftID    ----标题截取长度，0为不截取
	'        Ext       ----调用广告方式,0为联接,1为图片,2图片联接方式
	'        GGID      ----调用广告ID,0为随机,其他为广告ID

	'================================================
	Public Function LoadGuangGao(ByVal TopID,ByVal LeftID, ByVal Ext, ByVal GGID)
		Dim rs,sql,i,str

		IF Not IsNumeric(TopID) Then TopID=1
		if TopID<1 then TopID=1
		IF Not IsNumeric(LeftID) Then LeftID=0
		IF Not IsNumeric(Ext) Then Ext=0
		IF Not IsNumeric(GGID) Then GGID=0



		LeftID=int(LeftID)
		Ext=int(Ext)
		GGID=int(GGID)


		Sql = "select top "&TopID&" [name],[url] from qingtian_gg "



		select case GGID
			case 0
				Randomize
				Sql = sql & " Order by rnd( -(id+" & Rnd() & "))  desc "
			case else
				Sql = sql & " where id= "& ggid &" "
		end select



		Set Rs = Server.CreateObject("Adodb.Recordset")
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof) then
		For i=1 to rs.RecordCount
		If Rs.Eof Then
			exit For
		End If
			if ext=0 then
				str=str & "<a href="""&qingtian.utf8(rs("url"))&""">*"&qingtian.utf8(rs("name"))&"*</a><br/>"
			elseif ext=1 then
				str=str & "<img src="""&qingtian.utf8(rs("url"))&""" alt=''/><br/>"
			else
				str=str & "<a href="""&qingtian.utf8(rs("url"))&"""><img src="""&qingtian.utf8(rs("url"))&""" alt=''/></a><br/>"
			end if

		Rs.MoveNext
		Next

		end  if
		Rs.close
		set rs=nothing

		LoadGuangGao = str
	End Function








	'================================================
	'函数名：gongguao
	'作  用：读取公告
	'参  数：str ----原字符串
	'================================================
	Public Function gongguao(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList

		strTemp = str
		If InStr(strTemp, "[gongguao(") > 0 Then
			sTempContent = cutdate(strTemp, "[gongguao(", ")]", 1)
			nTempContent = cutdate(strTemp, "[gongguao(", ")]", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
                    		If UBound(ArrayList) = 3 Then
					strTemp = Replace(strTemp, arrTempContents(i), LoadGongGuao(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3)))
				End If
			Next
		End If

		gongguao = strTemp

	End Function
	'================================================
	'函数名：LoadGongGuao
	'作  用：读取公告
	'参  数：
	'        TopID     ----显示记录数
	'        LeftID    ----标题截取长度，0为不截取
	'        OrderID   ----排序，0为ID,2为随机
	'        OrderType ----排序,0为升序,1为降序

	'================================================
	Public Function LoadGongGuao(ByVal TopID,ByVal LeftID, ByVal OrderID, ByVal OrderType)
		Dim rs,sql,i,str

		IF Not IsNumeric(TopID) Then TopID=1
		if TopID<1 then TopID=1
		IF Not IsNumeric(LeftID) Then LeftID=0
		IF Not IsNumeric(OrderID) Then OrderID=0
		IF Not IsNumeric(OrderType) Then OrderType=0



		LeftID=int(LeftID)
		OrderID=int(OrderID)
		OrderType=int(OrderType)


		Sql = "select top "&TopID&" [id],[name] from qingtian_GongGuao "




		select case OrderID
			case 1
				Randomize
				Sql = sql & " Order by rnd( -(id+" & Rnd() & "))"
			case else
				Sql = sql & " Order by [id]"
		end select



		if OrderType=1 then
			Sql = sql & "  desc "
		else
			Sql = sql & "  asc "
		end if



		Set Rs = Server.CreateObject("Adodb.Recordset")
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof) then
		For i=1 to rs.RecordCount
		If Rs.Eof Then
			exit For
		End If
			str=str & "<a href=""/gongguaove.asp?id="&rs("id")&"&amp;sid="&sidd&""">"&qingtian.utf8(rs("name"))&"</a><br/>"

		Rs.MoveNext
		Next
		else
			str=str & "<br/>"

		end  if
		Rs.close
		set rs=nothing

		LoadGongGuao = str
	End Function





	'================================================
	'函数名：bbsclass
	'作  用：读取论坛分类
	'参  数：str ----原字符串
	'================================================
	Public Function bbsclass(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList

		strTemp = str
		If InStr(strTemp, "[bbsclass(") > 0 Then
			sTempContent = cutdate(strTemp, "[bbsclass(", ")]", 1)
			nTempContent = cutdate(strTemp, "[bbsclass(", ")]", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
                    		If UBound(ArrayList) = 4 Then
					strTemp = Replace(strTemp, arrTempContents(i), LoadBBSClass(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3), ArrayList(4)))
				End If
			Next
		End If

		bbsclass= strTemp

	End Function
	'================================================
	'函数名：LoadBBSClass
	'作  用：读取栏目分类
	'参  数：ClassID   ----分类ID
	'        LeftID    ----标题截取长度，0为不截取
	'        BrID    ----多少条记录换行,0为按设置换行,其他按数值换行
	'        OrderID   ----排序，0按排序设置排,1为ID,2为随机
	'        OrderType ----排序,0为升序,1为降序

	'================================================
	Public Function LoadBBSClass(ByVal ClassID, ByVal LeftID, ByVal BrID, ByVal OrderID, ByVal OrderType)
		Dim rs,sql,i,str
		IF Not IsNumeric(ClassID) Then ClassID=0
		IF Not IsNumeric(LeftID) Then LeftID=0
		IF Not IsNumeric(brID) Then brID=0
		IF Not IsNumeric(OrderID) Then OrderID=0
		IF Not IsNumeric(OrderType) Then OrderType=0


		ClassID=int(ClassID)
		LeftID=int(LeftID)
		brID=int(brID)
		OrderID=int(OrderID)
		OrderType=int(OrderType)


		Sql = "select [id],[name],[class],[br],[view] from qingtian_bbs where [del]=0 and [flag]=" & ClassID & " "



		select case OrderID
			case 1
				Sql = sql & " Order by [id]"
			case 2
				Randomize
				Sql = sql & " Order by rnd( -(id+" & Rnd() & "))"
			case else
				Sql = sql & " Order by [pid]"
		end select



		if OrderType=1 then
			Sql = sql & "  desc "
		else
			Sql = sql & "  asc "
		end if



		Set Rs = Server.CreateObject("Adodb.Recordset")
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof) then
		For i=1 to rs.RecordCount
		If Rs.Eof Then
			exit For
		End If

			if rs("view")=0 then
				if rs("class")=true then
					str=str & "<a href=""/bbs/index.asp?flag="&rs("id")&"&amp;sid="&sidd&""">"
				else
					str=str & "<a href=""/bbs/board.asp?listid="&rs("id")&"&amp;sid="&sidd&""">"
				end if
						if LeftID=0 then
							str=str & qingtian.utf8(rs("name")) & "</a>"
						else
							if len(rs("name"))>LeftID then
								str=str & qingtian.utf8(left(rs("name"),LeftID)) & "</a>"
							else
								str=str & qingtian.utf8(rs("name")) & "</a>"
							end if
						end if

			else
				str=str & qingtian.utf8(rs("name"))
			end if


			if brID=0 then
				if rs("br")=1 then
					str=str & "<br/>" & vbNewLine
				end if
			else
				if i mod brID =0  then
					str=str & "<br/>" & vbNewLine
				end if
			end if

		Rs.MoveNext
		Next
		end  if
		Rs.close
		set rs=nothing

		LoadBBSClass =str
	End Function



Public Function qingtiana()
call strSQL():call login():call tj():call online():call qingtian.shuru():dim a,i,code:if qingtian.code="qingtian" then:call qingtiant():else:dim rs_1,sql_1:Set Rs_1 = Server.CreateObject("Adodb.Recordset"):Sql_1 = "select [code] from qingtian_config":Rs_1.Open Sql_1,conn,1,1:if rs_1("code")<>"" then:code=rs_1("code"):else:code="000000;":end if:Rs_1.close:set rs_1=nothing:code=Split(code,";"):for i=0 to ubound(code):if UnEnco(code(i))=qingtian.ul then:a=1:Application("code")="qingtian":exit for:else:a=0:end if:next:if a=1 then:call qingtiant:else:call shouquan:end if:end if
End Function
	'================================================
	'函数名：linkclass
	'作  用：读取友链分类
	'参  数：str ----原字符串
	'================================================
	Public Function linkclass(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList

		strTemp = str
		If InStr(strTemp, "[linkclass(") > 0 Then
			sTempContent = cutdate(strTemp, "[linkclass(", ")]", 1)
			nTempContent = cutdate(strTemp, "[linkclass(", ")]", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
                    		If UBound(ArrayList) = 3 Then
					strTemp = Replace(strTemp, arrTempContents(i), LoadLinkClass(ArrayList(0), ArrayList(1), ArrayList(2), ArrayList(3)))
				End If
			Next
		End If

		linkclass = strTemp

	End Function
	'================================================
	'函数名：LoadLinkClass
	'作  用：读取友链分类
	'参  数：
	'        LeftID    ----标题截取长度，0为不截取
	'        BrID    ----多少条记录换行,0为按设置换行,其他按数值换行
	'        OrderID   ----排序，0按排序设置排,1为ID,2为随机
	'        OrderType ----排序,0为升序,1为降序

	'================================================
	Public Function LoadLinkClass(ByVal LeftID, ByVal BrID, ByVal OrderID, ByVal OrderType)
		Dim rs,sql,i,str

		IF Not IsNumeric(LeftID) Then LeftID=0
		IF Not IsNumeric(brID) Then brID=0
		IF Not IsNumeric(OrderID) Then OrderID=0
		IF Not IsNumeric(OrderType) Then OrderType=0



		LeftID=int(LeftID)
		brID=int(brID)
		OrderID=int(OrderID)
		OrderType=int(OrderType)


		Sql = "select [id],[name],[br] from [qingtian_link_class] "



		select case OrderID
			case 1
				Sql = sql & " Order by [id]"
			case 2
				Randomize
				Sql = sql & " Order by rnd( -(id+" & Rnd() & "))"
			case else
				Sql = sql & " Order by [pid]"
		end select



		if OrderType=1 then
			Sql = sql & "  desc "
		else
			Sql = sql & "  asc "
		end if



		Set Rs = Server.CreateObject("Adodb.Recordset")
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof) then
		For i=1 to rs.RecordCount
		If Rs.Eof Then
			exit For
		End If


				str=str & "<a href=""/link/list.asp?classid="&rs("id")&"&amp;sid="&sidd&""">"
						if LeftID=0 then
							str=str & qingtian.utf8(rs("name")) & "</a>"
						else
							if len(rs("name"))>LeftID then
								str=str & qingtian.utf8(left(rs("name"),LeftID)) & "</a>"
							else
								str=str & qingtian.utf8(rs("name")) & "</a>"
							end if
						end if


			if brID=0 then
				if rs("br")=1 then
					str=str & "<br/>" & vbNewLine
				end if
			else
				if i mod brID =0  then
					str=str & "<br/>" & vbNewLine
				end if
			end if


		Rs.MoveNext
		Next
		end  if
		Rs.close
		set rs=nothing

		LoadLinkClass = str
	End Function


	'================================================
	'函数名：time
	'作  用：时间格式化标签
	'参  数：str ----原字符串
	'================================================
	Public Function time(ByVal str)
		Dim strTemp, i
		Dim sTempContent, nTempContent
		Dim arrTempContent, arrTempContents, ArrayList

		strTemp = str
		If InStr(strTemp, "[time(") > 0 Then
			sTempContent = cutdate(strTemp, "[time(", ")]", 1)
			nTempContent = cutdate(strTemp, "[time(", ")]", 0)
			arrTempContents = Split(sTempContent, "|||")
			arrTempContent = Split(nTempContent, "|||")
			For i = 0 To UBound(arrTempContents)
				ArrayList = Split(arrTempContent(i), ",")
                    		If UBound(ArrayList) = 0 Then
					strTemp = Replace(strTemp, arrTempContents(i), FormatTime(ArrayList(0)))
				End If
			Next
		End If

		time = strTemp

	End Function

Public Function shouquan() 
select case v
case "0"
we0="<br/>"
book="&#x8BF7;&#x8BA4;&#x771F;&#x8F93;&#x5165;&#x6388;&#x6743;&#x7801;<BR/><input name='name' format='*N' size='15' /><br/><anchor>&#x8F93;&#x5165;&#x6388;&#x6743;&#x7801;<go href='index.asp?action=save&amp;sid="&sidd&"' method='post'><postfield name=""name"" value=""$(name:n)"" /></go></anchor><br/>"
title="<card title=""&#x8F6F;&#x4EF6;&#x6388;&#x6743;""><p align=""left"">"
case "1"
zi="<span style=""color:#FF5500"">"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
book=""&dao&"<form action=""index.asp?action=save&amp;sid="&sidd&""" method=""post"">&#x8BF7;&#x8BA4;&#x771F;&#x8F93;&#x5165;&#x6388;&#x6743;&#x7801;<BR/><input type=""text"" name=""name"" value="""" format=""*N"" size=""15"" /><br/><input type=""submit"" value=""&#x8F93;&#x5165;&#x6388;&#x6743;&#x7801;"" /></form>"&we0&""
title="<title>&#x8F6F;&#x4EF6;&#x6388;&#x6743;</title></head><body>"
End Select
Response.Write(""&title&""&sou&"&#x6B22;&#x8FCE;&#x4F7F;&#x7528;“&#x6674;&#x5929;3G&#x624B;&#x673A;&#x5EFA;&#x7AD9;&#x7CFB;&#x7EDF;”"&we0&"")
if Request.QueryString("action")="save" then
    name=qingtian.repsql(Request.form("name"))
    if qingtian.ul=UnEnco(name) then
    Application("code")="qingtian"
    conn.execute("update qingtian_config set [code]=code&'"&name&"'&';'")
    Response.Write(""&we&"&#x4F60;&#x7684;&#x8F6F;&#x4EF6;&#x6388;&#x6743;&#x6210;&#x529F;,&#x5237;&#x65B0;&#x672C;&#x9875;&#x5373;&#x53EF;&#x6B63;&#x5E38;&#x4F7F;&#x7528;&#x672C;&#x8F6F;&#x4EF6;!<BR/>")
    else
    Response.Write(""&we&"&#x4F60;&#x8F93;&#x5165;&#x6388;&#x6743;&#x7801;&#x4E0D;&#x6B63;&#x786E;,&#x8BF7;&#x91CD;&#x65B0;&#x8F93;&#x5165;&#x6216;&#x8D2D;&#x4E70;&#x6211;&#x4EEC;&#x7684;&#x6B63;&#x7248;&#x8F6F;&#x4EF6;!<BR/>")
    end if
end if
    Response.Write(""&book&"")  
End Function  

        '================================================
        '函数名：LoadWeekdayName
        '作  用：返回星期中文
        '参  数：id 
        '================================================
        Public Function LoadWeekdayName(ByVal id)
		dim strTemp

            Select Case id
                Case 1
                    strTemp = "星期一"
                Case 2
                    strTemp = "星期二"
                Case 3
                    strTemp = "星期三"
                Case 4
                    strTemp = "星期四"
                Case 5
                    strTemp = "星期五"
                Case 6
                    strTemp = "星期六"
                Case Else
                    strTemp = "星期日"
            End Select

            LoadWeekdayName = strTemp
        End Function



        '================================================
        '函数名：FormatTime
        '作  用：格式化时间
        '参  数：id ----格式化样式
        '================================================
        Public Function FormatTime(ByVal id)


            Dim strTemp
            Dim TimeTemp
                TimeTemp = Now()
            Select Case id
                Case 1
                    strTemp = TimeTemp
                Case 2
                    strTemp = Year(TimeTemp) & "-" & Month(TimeTemp) & "-" & Day(TimeTemp)
                Case 3
                    strTemp = Hour(TimeTemp) & ":" & Minute(TimeTemp) & ":" & Second(TimeTemp)
                Case 4
                    strTemp = Month(TimeTemp) & "-" & Day(TimeTemp) & " " & Hour(TimeTemp) & ":" & Minute(TimeTemp)
                Case 5
                    strTemp = Year(TimeTemp) & "年" & Month(TimeTemp) & "月" & Day(TimeTemp) & "日"
                Case 6
                    strTemp = Hour(TimeTemp) & "时" & Minute(TimeTemp) & "分" & Second(TimeTemp) & "秒"
                Case 7
                    strTemp = Year(TimeTemp) & "年" & Month(TimeTemp) & "月" & Day(TimeTemp) & "日" & " " & LoadWeekdayName(Weekday(TimeTemp))
                Case 8
                    strTemp = Month(TimeTemp) & "月" & Day(TimeTemp) & "日" & " " & LoadWeekdayName(Weekday(TimeTemp))
                Case 9
                    strTemp = Year(TimeTemp) & "-" & Month(TimeTemp) & "-" & Day(TimeTemp) & " " & LoadWeekdayName(Weekday(TimeTemp))
                Case 10
                    strTemp = Month(TimeTemp) & "-" & Day(TimeTemp) & " " & LoadWeekdayName(Weekday(TimeTemp))
                Case 11
                    strTemp = Hour(TimeTemp) & "时" & Minute(TimeTemp) & "分" & Second(TimeTemp) & "秒" & " " & LoadWeekdayName(Weekday(TimeTemp))
                Case 12
                    strTemp = Hour(TimeTemp) & "时" & Minute(TimeTemp) & "分" & " " & LoadWeekdayName(Weekday(TimeTemp))
                Case 13
                    strTemp = Hour(TimeTemp) & ":" & Minute(TimeTemp) & ":" & Second(TimeTemp) & " " & LoadWeekdayName(Weekday(TimeTemp))
                Case 14
                    strTemp = Hour(TimeTemp) & ":" & Minute(TimeTemp) & " " & LoadWeekdayName(Weekday(TimeTemp))
                Case 15
                    strTemp = Year(TimeTemp) & "年" & Month(TimeTemp) & "月" & Day(TimeTemp) & "日" & Hour(TimeTemp) & "时" & Minute(TimeTemp) & "分" & Second(TimeTemp) & "秒" & " " & LoadWeekdayName(Weekday(TimeTemp))
                Case 16
                    strTemp = TimeTemp & " " & LoadWeekdayName(Weekday(TimeTemp))
                Case 17
                    strTemp = Month(TimeTemp) & "月" & Day(TimeTemp) & "日" & Hour(TimeTemp) & "时" & Minute(TimeTemp) & "分" & " " & LoadWeekdayName(Weekday(TimeTemp))
                Case 18
                    strTemp = Month(TimeTemp) & "-" & Day(TimeTemp) & " " & Hour(TimeTemp) & ":" & Minute(TimeTemp) & " " & LoadWeekdayName(Weekday(TimeTemp))
                Case 19
                    strTemp = LoadWeekdayName(Weekday(TimeTemp))
                Case Else
                    strTemp = TimeTemp
            End Select



            FormatTime = strTemp
        End Function



end class


%>